//
//  ZXStatusDetailFrm.m
//  ZXOCWeiBo
//
//  Created by mac on 15/12/10.
//  Copyright © 2015年 itcast. All rights reserved.
//

#import "ZXStatusDetailFrm.h"

@implementation ZXStatusDetailFrm

-(void)setStatuses:(ZXStatuses *)statuses
{
    _statuses = statuses;
    
    //计算orginalFrm
    
    ZXStatusOriginalFrm * originalFrm = [[ZXStatusOriginalFrm alloc]init];
    originalFrm.statuses = statuses;
    self.orginalFrm = originalFrm;
    
//    判断是否有转发微博
    if (statuses.retweeted_status)
    {
        //计算转发微博frm
        ZXStatusRetweetedFrm * retweetedFrm = [[ZXStatusRetweetedFrm alloc]init];
        retweetedFrm.retweetedStatus = statuses.retweeted_status;
        self.retweetedFrm = retweetedFrm;
        
        //重新计算retweetedFrm 的selfFrm的Y
        CGRect retweetedViewFrm = retweetedFrm.selfFrm;
        retweetedViewFrm.origin.y = CGRectGetMaxY(originalFrm.selfFrm);
        retweetedFrm.selfFrm = retweetedViewFrm;
    }
    
//    设置statusDetailView的frm
    CGFloat selfH = CGRectGetMaxY(originalFrm.selfFrm);
    if (statuses.retweeted_status)
    {
        selfH = CGRectGetMaxY(self.retweetedFrm.selfFrm);
    }
    
    self.selfFrm = CGRectMake(0, 10, UIScreenW, selfH);
    
    
}

@end
